//
//  ClassLeftCell.m
//  DiningCar-Business
//
//  Created by 吕晶 on 2020/4/13.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "ClassLeftCell.h"
#import "CashierClassModel.h"

@interface ClassLeftCell ()

@property (nonatomic, strong) UILabel *nameLab;

@end

@implementation ClassLeftCell

+ (instancetype)ClassLeftCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"ClassLeftCell";
    ClassLeftCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[ClassLeftCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = HexColor(0xffffff);
        
        self.nameLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 16, 90, 18)];
        self.nameLab.textColor = HexColor(0x9E9FB5);
        self.nameLab.font = [UIFont systemFontOfSize:14];
        self.nameLab.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.nameLab];
        
        self.height = 50;
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 90, 50)];
        view.backgroundColor = HexColor(0xF0F2F5);
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(2, 20, 4, 10)];
        lineView.backgroundColor = HexColor(0xFF5858);
        lineView.layer.cornerRadius = 2;
        [view addSubview:lineView];
        self.selectedBackgroundView = view;
    }
    return self;
}

-(void)setClassModel:(CashierClassModel *)classModel {
    _classModel = classModel;
    self.nameLab.text = classModel.class_name;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
